
import request from '@/utils/request'

//创建文章分享链接
export const createShareLink = (data) => {
  return request({
    url: '/api/v1/share/chapter/create',
    method: 'post',
    data
  })
}

//创建章节版本分享链接
export const createShareVersionLink = (data) => {
  return request({
    url: '/api/v1/share/version/create',
    method: 'post',
    data
  })
}

//编辑分享链接权限
export const editShareLink = (data) => {
  return request({
    url: '/api/v1/share/edit',
    method: 'post',
    data
  })
}

//删除分享链接
export const deleteShareLink = (data) => {
  return request({
    url: '/api/v1/share/delete',
    method: 'post',
    data
  })
}

//删除所有分享链接
export const deleteAllShareLink = (data) => {
  return request({
    url: '/api/v1/share/delete/all',
    method: 'post',
    data
  })
}

//查看指定作品下已分享的章节及管理接口
export const getShareList = (data) => {
  return request({
    url: '/api/v1/share/list',
    method: 'post',
    data
  })
}

//根据分享链接Token查看内容
export const getShareContent = (token) => {
  return request({
    url: `/api/v1/share/${token}`,
    method: 'get'
  })
}

//复制分享链接
export const copyShareLink = (data) => {
  return request({
    url: '/api/v1/share/copy',
    method: 'post',
    data
  })
}